import { Module } from '@nestjs/common';
import { AuthController } from './auth.controller';
import { AuthService } from './auth.service';
import { APP_GUARD } from '@nestjs/core';
import { AuthGuard } from './auth.guard';
import { UserModule } from '../user/user.module';
import {JwtModule} from '@nestjs/jwt';
@Module({
  imports:[UserModule,JwtModule.register({
    global:true,
    secret:'abcdefg',
    signOptions:{expiresIn:24*60*60+'s'}
  })],
  controllers: [AuthController],
  providers: [
    AuthService, 
    {
      provide: APP_GUARD,
      useClass: AuthGuard,
    },
  ],
})
export class AuthModule {}
